package thread;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 19182
 * Date: 2025-08-13
 * Time: 18:02
 */
public class demo8 {
    public static void main(String[] args) {
        Thread t = new Thread(()->{
            System.out.println("hello thread");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            ;
        });
        t.setDaemon(true); //把前台线程设置为后台线程
        t.start();
        System.out.println("main 执行完毕");
    }
}
